<style>
    #treeview{
        display: flex;
        flex-direction: column;
    }
    .checkbox_input{
        width: 80%;
        display: flex;
        align-items:center;
    }
    .fields_name{
        border: 1px solid #ccc;
        margin-left: 10px;
        margin-bottom: 10px;
    }
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('所属图表')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-pid" data-rule="required" class="form-control selectpicker" name="row[parent_id]">
                {foreach name="parentList" item="vo"}
                <option  value="{$key}" {in name="key" value=""}selected{/in}>{$vo.name}</option>
                {/foreach}
            </select>
            <!--<input id="c-parent_id" data-rule="required" min="0" data-source="parent/index" class="form-control selectpage" name="row[parent_id]" type="text" value="">-->
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('选择数据图表')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-chart_table_list_id" data-rule="required" class="form-control selectpicker" name="row[chart_table_list_id]">
                {foreach($chart_table_list as $k=>$v)}
                <option  value="{$v['id']}">{$v.table_name_zh}</option>
                {/foreach}
            </select>
        </div>
    </div>



    <!--选中字段-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('fields')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div id="treeview">
                {foreach $fieldsList as $k=>$v}
                <div class="checkbox_input">
                    <div>
                        <input type="checkbox" name="row[{$k}]" id="" value="{$k}"/>
                        <label>{$v}</label>
                    </div>
                    <div>
                        <input class="fields_name" type="text" name="row[{$k}_as]" value="" placeholder="请输入别名">
                    </div>
                </div>
                {/foreach}
            </div>
        </div>
    </div>

    <!--双Y轴数据字段选择-->
    <div class="form-group">
        <label for="c-y_axial_2" class="control-label col-xs-12 col-sm-2">{:__('双Y轴数据字段选择')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div id="y_axial_2">
                <select id="c-y_axial_2" data-rule="required" class="form-control " name="row[y_axial_2]">
                    <option  value="">请选择</option>
                    {foreach $fieldsList as $k=>$v}
                    <option  value="$k">{$v}</option>
                    {/foreach}
                </select>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required; length(~30)" class="form-control" name="row[name]" type="text">
        </div>
    </div>
<!--    <div class="form-group">
        <label for="c-table" class="control-label col-xs-12 col-sm-2">{:__('Table')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-table" data-rule="required; length(5~30)" class="form-control" name="row[table]" type="text">
        </div>
    </div>-->
<!--    <div class="form-group">
        <label for="c-diyname" class="control-label col-xs-12 col-sm-2">{:__('Diyname')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-diyname" data-rule="required;diyname" class="form-control" name="row[diyname]" type="text" value="" data-tip="用于伪静态规则中[:diyname]替换">
        </div>
    </div>-->
    <div class="form-group">
        <label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('简介')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text">
        </div>
    </div>

    <!--    坐标轴最小间隔大小-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('min_interval')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-min_interval" class="form-control" name="row[min_interval]" type="number" step="any" min="0" data-rule="" value="0">
        </div>
    </div>

    <!--    坐标轴最大间隔大小-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('max_interval')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-max_interval" class="form-control" name="row[max_interval]" type="number" step="any" min="0" data-rule="" value="0">
        </div>
    </div>


    <!--权重-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" step="1" min="0" data-rule="required;digits;integer;range(0~)" value="0">
        </div>
    </div>

    <!--    会员价格-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Membership_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-membership_price" class="form-control" name="row[membership_price]" type="number" step="any" min="0" data-rule="required;range(0~)" value="0">
        </div>
    </div>
    <!--    会员时长-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Membership_duration')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-membership_duration" class="form-control" name="row[membership_duration]" type="number" step="1" min="0" data-rule="required;digits;integer;range(0~)" value="0">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:Form::radios("row[status]", $statusList, 'normal')}
        </div>
    </div>

    <!--    <div class="form-group">
            <label for="c-seotitle" class="control-label col-xs-12 col-sm-2">{:__('Seotitle')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-seotitle" data-rule="" class="form-control" name="row[seotitle]" type="text" value="" placeholder="为空时将使用表单标题">
            </div>
        </div>
        <div class="form-group">
            <label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-keywords" data-rule="" class="form-control" name="row[keywords]" data-role="tagsinput" type="text" value="">
            </div>
        </div>
        <div class="form-group">
            <label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea id="c-description" cols="60" rows="5" data-rule="" class="form-control" name="row[description]"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label for="c-successtips" class="control-label col-xs-12 col-sm-2">{:__('Successtips')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-successtips" data-rule="" class="form-control" name="row[successtips]" />
            </div>
        </div>
        <div class="form-group">
            <label for="c-redirecturl" class="control-label col-xs-12 col-sm-2">{:__('Redirecturl')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-redirecturl" data-rule="" class="form-control" name="row[redirecturl]" type="text" placeholder="{:__('Redirecturl tips')}" value="">
            </div>
        </div>
        <div class="form-group">
            <label for="c-posttpl" class="control-label col-xs-12 col-sm-2">{:__('Posttpl')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-posttpl" data-rule="" class="form-control selectpage" name="row[posttpl]" data-source="cms/ajax/get_template_list" data-params='{"type":"diyform_post"}' data-primary-key="name" data-field="name" type="text" placeholder="自定义模板文件必须以diyform_post开头">
            </div>
        </div>
        <div class="form-group">
            <label for="c-listtpl" class="control-label col-xs-12 col-sm-2">{:__('Listtpl')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-listtpl" data-rule="" class="form-control selectpage" name="row[listtpl]" data-source="cms/ajax/get_template_list" data-params='{"type":"diyform_list"}' data-primary-key="name" data-field="name" type="text" placeholder="自定义模板文件必须以diyform_list开头">
            </div>
        </div>
        <div class="form-group">
            <label for="c-showtpl" class="control-label col-xs-12 col-sm-2">{:__('Showtpl')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-showtpl" data-rule="" class="form-control selectpage" name="row[showtpl]" data-source="cms/ajax/get_template_list" data-params='{"type":"diyform_show"}' data-primary-key="name" data-field="name" type="text" placeholder="自定义模板文件必须以diyform_show开头">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('isedit')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input  id="c-isedit" name="row[isedit]" type="hidden" value="0">
                <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-isedit" data-yes="1" data-no="0" >
                    <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
                </a>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('iscaptcha')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input  id="c-iscaptcha" name="row[iscaptcha]" type="hidden" value="0">
                <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-iscaptcha" data-yes="1" data-no="0" >
                    <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
                </a>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('isguest')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input  id="c-isguest" name="row[isguest]" type="hidden" value="0">
                <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-isguest" data-yes="1" data-no="0" >
                    <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
                </a>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Needlogin')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input  id="c-needlogin" name="row[needlogin]" type="hidden" value="0">
                <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-needlogin" data-yes="1" data-no="0" >
                    <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
                </a>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Usermode')}:</label>
            <div class="col-xs-12 col-sm-8">
                {:Form::radios("row[usermode]", ['all'=>'全部', 'user'=>'仅用户本人数据'], 'user')}
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Statusmode')}:</label>
            <div class="col-xs-12 col-sm-8">
                {:Form::radios("row[statusmode]", ['all'=>'全部', 'normal'=>'仅已审核数据(状态正常)'], 'normal')}
            </div>
        </div>
      -->

    <!--创建时间-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Createtime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-createtime" data-rule="required" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[createtime]" type="text" value="{:date('Y-m-d H:i:s')}">
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

